package com.boronstream.istar.http.request;

import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;

import com.boronstream.istar.http.PlayRequest;
import com.boronstream.istar.http.response.HoroscopeResponse;
import com.boronstream.istar.utils.CommonDefine;

public class HoroscopeRequest implements PlayRequest<HoroscopeResponse> {
	private final HttpMethodType HTTP_METHOD_TYPE = HttpMethodType.GET;
	private Map<String, Object> parmas= new HashMap<String, Object>();
	private Map<String, String>  headers = new HashMap<String, String>();

	private String starName;
	@Override
	public String getApiMethodName() {
		try {
			return String.format(CommonDefine.API_METHOD_HOROSCOPE, URLEncoder.encode(starName, "UTF-8"));
		} catch (Exception e) {
			e.printStackTrace();
		}
		return CommonDefine.API_METHOD_HOROSCOPE;
	}

	@Override
	public Map<String, Object> getRequestParams() {
		return this.parmas;
	}

	@Override
	public Map<String, String> getRequestHeaders() {
		return this.headers;
	}

	@Override
	public void setRequestParams(Map<String, Object> parmas) {
		this.parmas = parmas;
	}

	@Override
	public String getJsonParams() {
		return null;
	}

	public void setStarName(String starName) {
		this.starName = starName;
	}
	@Override
	public com.boronstream.istar.http.PlayRequest.HttpMethodType getHttpMethodType() {
		return HTTP_METHOD_TYPE;
	}

	@Override
	public Class<HoroscopeResponse> getResponseClass() {
		return HoroscopeResponse.class;
	}

}
